package cn.zahou.SJR.druid;

import cn.zahou.SJR.JDBCToolsc.Jdbc_toolsc;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class DruidTools {
    public static void main(String[] args) {
        Connection connection=null;
        PreparedStatement pstmt=null;

        try {
            connection= Jdbc_toolsc.getConnection();
            String sql="insert into emp values(null,'燕赤霞','男',8888.00,'2000-12-1',1)";
//            获取pstmt对象
            pstmt=connection.prepareStatement(sql);
//            这里赋值跳过,采用直接赋值法
//            pstmt.setString();
            int count=pstmt.executeUpdate();
            System.out.println("本次操作共影响"+count+"条记录.");
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }finally {
            Jdbc_toolsc.close(pstmt,connection);
        }

    }
}
